import ajax from './ajax'
const BASE_URL = '/api'

export const registerReq =(user)=>ajax(BASE_URL+'/register',user,'POST')

export const loginReq = (username,password) => ajax(BASE_URL+'/login',{ username,password },'POST')

export const updateUserReq = (user) => ajax(BASE_URL+'/update',user,'POST')

export const getUserReq = () => ajax(BASE_URL+'/user')

export const userListReq = (userType) => ajax(BASE_URL+'/userlist',{ userType })

export const getChatMsgListReq = () => ajax(BASE_URL+'/msgList')

export const readMsgReq = (from) => ajax(BASE_URL+'/readMsg',{ from },'POST')